﻿@using GameSchool.HtmlHelpers
@model GameSchool.ViewModels.Course.CreateViewModel
@{
    ViewBag.Title = "Skrá nýtt námskeið";
}
<h2>
    Skrá nýtt námskeið
</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm(htmlAttributes: new { @class = "form-horizontal" }))
{
    <div>
        <fieldset>
            <legend>Námskeiðsupplýsingar</legend>
            <div class="control-group">
                @Html.LabelFor(m => m.course.Name, new { @class = "control-label" }, "Heiti")
                <div class="controls">
                    @Html.TextBoxFor(m => m.course.Name, new { @class = "input-xlarge" })
                    @Html.ValidationMessageFor(m => m.course.Name)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(m => m.course.Code, new { @class = "control-label" }, "Kóti (10 stafir)")
                <div class="controls">
                    @Html.TextBoxFor(m => m.course.Code, new { @class = "input-xlarge" })
                    @Html.ValidationMessageFor(m => m.course.Code)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(m => m.course.Description, new { @class = "control-label" }, "Lýsing")
                <div class="controls">
                    @Html.TextAreaFor(m => m.course.Description, new { @class = "input-xlarge", rows = "8" })
                    @Html.ValidationMessageFor(m => m.course.Description)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(m => m.course.SemesterID, new { @class = "control-label" }, "Önn")
                <div class="controls">
                    @Html.DropDownListFor(m => m.course.SemesterID, Model.semesters, new { @class = "span3" })
                    @Html.ValidationMessageFor(m => m.course.SemesterID)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(m => m.course.TeacherUserID, new { @class = "control-label" }, "Kennari")
                <div class="controls">
                    @Html.DropDownListFor(m => m.course.TeacherUserID, Model.teachers, new { @class = "span3" })
                    @Html.ValidationMessageFor(m => m.course.TeacherUserID)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(m => m.course.Credits, new { @class = "control-label" }, "Einingar")
                <div class="controls">
                    @Html.TextBoxFor(m => m.course.Credits, new { @class = "input-small", type = "number" })
                    @Html.ValidationMessageFor(m => m.course.Credits)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(m => m.course.IsActive, new { @class = "control-label" }, "Er virkt")
                <div class="controls">
                    @Html.CheckBoxFor(m => m.course.IsActive)
                    @Html.ValidationMessageFor(m => m.course.IsActive)
                </div>
            </div>
            <div class="form-actions">
                <input type="submit" class="btn btn-primary" value="Skrá áfanga" />
                <a href="@Url.Action("List")" class="btn">Til baka í námskeiðslista</a>
            </div>
        </fieldset>
    </div>
}
